@import 'sulu-admin-bundle/containers/Application/colors.scss';

$mediaCardBorderColor: $alto;
$headerBackgroundColor: $white;
$metaInfoTextColor: $silverChalice;
$coverBackgroundColor: rgba($black, .5);
$coverIconTextColor: $white;
$mediaCardBorderRadius: 3px;
$downloadButtonBackgroundColor: $headerBackgroundColor;
$downloadButtonBackgroundColorActive: $shakespeare;
$downloadButtonTextColor: $alto;
$downloadButtonTextColorActive: $white;
$downloadButtonBorderColorActive: $shakespeare;

.media-card {
    width: 240px;
    border: 1px solid $mediaCardBorderColor;

    &:hover,
    &.selected {
        .checkbox {
            margin-left: 0;
        }
    }
}

.header {
    display: flex;
    position: relative;
    cursor: pointer;
}

.header-click-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.description {
    width: 100%;
    padding: 20px;
    border-bottom: 1px solid $mediaCardBorderColor;
    border-radius: $mediaCardBorderRadius 0 0 0;
    background-color: $headerBackgroundColor;

    &:focus .checkbox {
        margin-left: 0;
    }

    .no-download-list & {
        border-radius: $mediaCardBorderRadius $mediaCardBorderRadius 0 0;
    }
}

.download-button {
    width: 32px;
    height: 100%;
    border: 0;
    font-size: 12px;
    cursor: pointer;
    background-color: $downloadButtonBackgroundColor;
    color: $downloadButtonTextColor;
    border-width: 0 0 1px 1px;
    border-style: solid;
    border-color: $mediaCardBorderColor;
    border-radius: 0 $mediaCardBorderRadius 0 0;

    &:hover,
    &:focus,
    &.active {
        background-color: $downloadButtonBackgroundColorActive;
        color: $downloadButtonTextColorActive;
        border-color: $downloadButtonBackgroundColorActive;
    }
}

.checkbox {
    margin-left: -26px;
    will-change: margin-left;
    transition: margin-left .15s linear;

    input[type='checkbox'] {
        visibility: hidden;
    }
}

.ghost-indicator {
    margin-right: 5px;
}

.title {
    pointer-events: none; /* We don't want the label/title to trigger an "onClick" event */
    position: relative;
    font-size: 12px;
    font-weight: bold;
    height: 21px;
    margin-bottom: 10px;
    overflow: hidden;
}

.meta,
.title-text {
    display: flex;
    width: 140px;
}

.meta {
    color: $metaInfoTextColor;
    font-size: 10px;
}

.media {
    position: relative;
    cursor: pointer;
    background-image: url('./checkerBackground.gif');
    overflow: hidden;
    transform: scale(1);
    border-radius: 0 0 $mediaCardBorderRadius $mediaCardBorderRadius;

    img {
        margin: 0 auto;
        display: block;
        transform: scale(1);
        will-change: transform;
        transition: transform .2s linear;
    }

    &:hover,
    &:focus,
    .show-cover & {
        .cover {
            opacity: 1;
        }

        img {
            transform: scale(1.05);
        }
    }
}

.cover {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-color: $coverBackgroundColor;
    will-change: opacity;
    transition: opacity .2s linear;
}

.media-icon {
    display: flex;
    color: $coverIconTextColor;
    font-size: 20px;
}
